<template>
  <div>
    <h3>AddItem组件</h3>
    <p>已知库存数: {{ $store.state.num }}</p>
    <button @click="$store.commit('addNum')">库存+1</button>
    <button @click="$store.dispatch('asyncAddNum', 9)">延迟2秒，库存+9</button>
  </div>
</template>

<script>
export default {};
</script>